from utils.excel_util import ExcelUtil
from model.sysRoleMenuModel import SysRoleMenu
from schema.sysRoleMenuSchema import SysRoleMenuCreate
from typing import List, Any, Dict, ClassVar
from io import BytesIO
from datetime import datetime


class SysRoleMenuExcel:
    # Define export columns
    COLUMNS: ClassVar[List[Dict[str, Any]]] = [

    ]

    @classmethod
    def get_export_columns(cls) -> List[Dict[str, Any]]:
        return [

        ]

    @classmethod
    def get_import_template(cls) -> BytesIO:
        """Get import template"""
        example_data = [{

        }]
        return ExcelUtil.create_import_template(
            columns=cls.COLUMNS,
            example_data=example_data,
            sheet_name="角色和菜单关联表导入模板"
        )

    @classmethod
    async def export_data(cls, data: List[Any]) -> BytesIO:
        """Export data"""
        return await ExcelUtil.export_data(
            data=data,
            columns=cls.get_export_columns(),
            sheet_name="角色和菜单关联表数据"
        )

    @classmethod
    def parse_import_data(cls, file: BytesIO) -> List[Dict[str, Any]]:
        """Parse import data"""
        return ExcelUtil.parse_import_data(
            file=file,
            columns=cls.COLUMNS,
            schema_cls=SysRoleMenuCreate
        )